<html>
<head>
    <meta charset="utf-8">
    <title>WindowEvent</title>
</head>
<body>
<input type="button" value="新窗口中打开网页" onclick="OpenNewWindow()">
<script type="text/javascript">
    function OpenNewWindow() {
     let openedWindow = window.open("https://www.baidu.com", "_blank");
     if (openedWindow) {
         openedWindow.focus();
     } else {
         console.warn("浏览器可能阻止了弹窗！");
     }
 }
</script>
</body>
</html>